package com.ti.winona.ui.fragment;

import com.taplinker.client.App;
import com.taplinker.client.R;
import com.ti.winona.util.FragmentOperateUtil;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

public class AcademicFragment extends Fragment {
	
	public static final String TAG = "AcademicFragment";
	
	private View mAcademicView;
	
	private ImageView mImgAcadBack;
	
	private View mLinAcadPapersView;
	private View mLinAcadMeetingView;
	private View mLinAcadLectureView;
	private View mLinAcadCosmetologyView;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		return mAcademicView = inflater.inflate(R.layout.fragment_academic, container, false);
	}

	@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		super.onViewCreated(view, savedInstanceState);
		
		findView();
		initListener();
	}

	private void findView() {
		mImgAcadBack = (ImageView) mAcademicView.findViewById(R.id.img_academic_back);
		
		mLinAcadPapersView = mAcademicView.findViewById(R.id.lin_academic_papers);
		mLinAcadMeetingView = mAcademicView.findViewById(R.id.lin_academic_meeting);
		mLinAcadLectureView = mAcademicView.findViewById(R.id.lin_academic_lecture);
		mLinAcadCosmetologyView = mAcademicView.findViewById(R.id.lin_academic_cosmetology);
	}
	
	private void initListener() {
		// 返回
		mImgAcadBack.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				FragmentOperateUtil.popFragmentBackStack(getActivity().getSupportFragmentManager());
			}
		});
		// 学术论文
		mLinAcadPapersView.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				App.showToast("学术论文");
			}
		});
		// 学术活动
		mLinAcadMeetingView.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				App.showToast("学术活动");
			}
		});
		// 专家讲堂
		mLinAcadLectureView.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				App.showToast("专家讲堂");
			}
		});
		// 医学美容
		mLinAcadCosmetologyView.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				App.showToast("医学美容");
			}
		});
	}
	
}
